<!DOCTYPE html>

<html>
	<head>
		<meta charset="utf-8" />
		<title>PutCategorie</title>
	</head>

	<body>
		<?php
			
			$requete = "INSERT INTO categorie (titre_cat, description_cat) VALUES ('" . $_POST['titre'] . "', '" . $_POST['description'] . "');";
			echo $requete;
			$mysqli = new mysqli("localhost", "root", "root", "forum");
			
			/* Vérification de la connexion */
			if (mysqli_connect_errno())
				{
    				echo 'Échec de la connexion : ' . mysqli_error();
    				exit;
				}

			if ($response = $mysqli->query($requete))
				{
						echo '<script type="text/javascript">
							document.location.href="affCategorie.php";
						</script>';
				}
			else 
				{
						/*echo '<script type="text/javascript">
							document.location.href="index.php";
						</script>';				*/
					
				}
		?>
	</body>
</html>